<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<img alt="" src="./images/title.png">
<hr>
<title>雇员信息列表</title>
<script type="text/javascript">
<!--
function delfirm(val){
		return window.confirm("是否要删除id="+val+"的用户");
	}
</script>
</head>
<?php 
require_once 'Emp.service.class.php';
require_once 'FenyePage.class.php';
$empservice=new Empservice();


//每页显示条数
$fenyePage=new FenyePage();
//当前页,默认为第一页
$fenyePage->pageNow=1;
$fenyePage->pageSize=6;
$fenyePage->gotoUrl="empList.php";
if(!empty($_GET['pageNow'])){
    $fenyePage->pageNow=$_GET['pageNow'];
}


$empservice->getFenyePage($fenyePage);


echo "<table border='1'><tr><th>id</th><th>name</th><th>grade</th><th>email</th><th>salary</th><th>操作</th><th>操作</th></tr>";
/* while($row=$res->fetch_assoc()){
    echo "<tr><td>{$row['id']}</td><td>{$row['name']}</td><td>{$row['grade']}</td><td>{$row['email']}</td><td>{$row['salary']}</td><td><a href='#'>修改</a></td><td><a href='#'>删除</a></td></tr>";
} */
for($i=0;$i<count($fenyePage->res_array);$i++){
    $row=$fenyePage->res_array[$i];
    $id=$row['id'];
    echo "<tr><td>{$row['id']}</td><td>{$row['name']}</td><td>{$row['grade']}</td><td>{$row['email']}</td><td>{$row['salary']}</td><td><a  href='updateEmp.php?flag=update&id={$row['id']}'>修改</a></td><td><a  onclick='return delfirm({$row['id']})' href='empProcess.php?flag=del&id={$row['id']}'>删除</a></td></tr>";
}
echo "</table>";
echo $fenyePage->navigate;



?>
<form action="empList.php">
跳转到:<input type="text" name=pageNow>
<input type="submit" value="GO"/>
</form>
<hr>
<img alt="" src="./images/end.png">
</html>